package edu.uwg.LewisWilliams.android.lab1;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;

public class GetUserNameActivity  extends Activity implements OnClickListener{
	private EditText editText;
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.get_user_name);
        editText = (EditText) this.findViewById(R.id.nameEntered);
        
        Button okButton = (Button) this.findViewById(R.id.okButton);
        okButton.setOnClickListener(this);
    }
    
	public void onClick(View v) {
		Editable userName = editText.getText();
		Intent intent = new Intent(this, HelloActivity.class);
		intent.putExtra("userName", userName.toString());
		
		this.startActivity(intent);
	}
    	
}
